<template>
    <div>
        <p v-for="item of hots" :key="item">
            
            <button @click="changeCity(item)">{{item}}</button>
        </p>
    </div>
</template>

<script>
export default {
    data(){
        return{
            hots:["武汉","长沙","苏州"]
        }
    },
    methods:{
        changeCity(val){
            // console.log(val);
            this.$store.dispatch("changeCity",val);
            this.$router.back();
        }
    }
}
</script>

<style>

</style>